/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.service.organization;
import com.alibaba.fastjson.JSONObject;
import com.qinyeit.serviceapp.entity.MaterialCategory;
import com.qinyetech.springstage.core.lang.QyMap;
import com.qinyetech.springstage.core.service.IBaseTreeableService;
import com.qinyeit.serviceapp.entity.District;

import java.util.List;
import java.util.Map;

/** 
 * ClassName: DistrictService <br/> 
 * Function: 区域业务功能 <br/> 
 * date: 2018-11-20 13:20:11 <br/> 
 * 
 * @author liuwenjin
 * @version 1.0
 * @since JDK 1.8
 */
public interface DistrictService extends IBaseTreeableService<District, Long>{

    /**
     * 保存区域 商户组为根节点
     * @param data
     */
    void saveData(JSONObject data, Long merchantGroupId);

    /**
     * 树形
     * @param merchantGroupId
     * @return
     */
    public List<District> getBuildTree(Long merchantGroupId);

    /**
     * 树形  是否显示区域的门店
     *
     * @param merchantGroupId
     * @return
     */
    public List<District> getBuildTree(Long merchantGroupId,Boolean useBranch);

    /**
     * 树形  是否显示区域的门店 和 区域
     *
     * @param merchantGroupId
     * @return
     */
    public List<District> getBuildTree(Long merchantGroupId,Boolean useBranch,Boolean useDistrict);


    /**
     * 树形  是否显示区域的门店 只显示某些门店
     * @param merchantGroupId
     * @param useBranch 是否显示门店
     * @param branchIds 显示的门店
     * @param flag 是否是级联门店
     * @return
     */
    public List<District> getBuildTree(Long merchantGroupId,Boolean useBranch,List<Long> branchIds,Boolean flag);

    /**
     * 根据区域获取部门 及 可管理的区域
     * @param id
     * @param merchantGroupId
     * @return
     *    departmentList
     *    districtList
     *    branchList
     */
    QyMap getDepartment(Long id,Long merchantGroupId);

}